package Chapter01;
import java.util.Scanner;
public class VisitorsTest {
    public static void main(String[] args) {
        Scanner input =new Scanner(System.in);
        while(true){
            Visitors visitors =new Visitors();
            System.out.println("请输入姓名:");
            visitors.name=input.next();
            System.out.println("请输入年龄:");
            visitors.age=input.nextInt();
            if (visitors.age<=14){
                visitors.piaojia=0;
                visitors.show();
            }else if (visitors.age>14 && visitors.age<60){
                visitors.piaojia=20;
                visitors.show();
            }else if (visitors.age>=60){
                visitors.piaojia=10;
                visitors.show();
            }else if (visitors.name=="n"){
                System.out.println("程序退出!");
                break;
            }
        }
    }
}
